﻿#pragma once
#include "Constant.h"
#include "TimeSys.h"
#include "CoordSys.h"
#include "ReadN.h"

// 卫星位置计算基类
class GNSSSatPos {
public:
    GNSSSatPos(TimeSys* timeSys, ReadN* readN);
public:
    /* 虚函数或纯虚函数 */
    virtual XYZ get_satPos(string prn, BaseT obsTime) = 0;
protected:
    bool is_geo(string& satID);
    double solve_kepler(double M, double e, double tolerance = 1e-12);
protected:
    TimeSys* mTimeSys;
    ReadN* mReadN;
};

// 北斗卫星位置计算派生类
class BDSSatPos : public GNSSSatPos {
public:
    BDSSatPos(TimeSys* ts1, ReadN* r1) : GNSSSatPos(ts1, r1) {};/* 初始化成员列表用法，调用基类构造函数*/
public:
    XYZ get_satPos(string prn, BaseT obsTime);
};

// GPS卫星位置计算派生类
class GPSSatPos : public GNSSSatPos {
public:
    GPSSatPos(TimeSys* ts1, ReadN* r1) : GNSSSatPos(ts1, r1) {};/* 初始化成员列表用法，调用基类构造函数*/
public:
    XYZ get_satPos(string prn, BaseT obsTime);
};
